package cn.tedu.boot34.controller;

import cn.tedu.boot34.entity.Emp;
import cn.tedu.boot34.mapper.EmpMapper;
import org.apache.ibatis.annotations.Insert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class EmpController {
    @Autowired(required = false)
    EmpMapper mapper;

    @RequestMapping("/insert")
    public String insert(Emp emp) {
        mapper.insert(emp);
        return "添加完成";
    }

    @RequestMapping("/select")
    public String selectByid() {
        Emp e = mapper.selectByid();
        return e.getName()+e.getSal()+e.getJob();
    }
}









